package com.rental.houses.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rental.common.result.AjaxResult;
import com.rental.model.entity.house.RequiredHouse;
import com.rental.model.form.house.RequiredHouseForm;
import com.rental.model.form.house.RequiredHousePage;
import com.rental.model.form.house.RequiredReportForm;
import com.rental.model.vo.house.RequiredHouseVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.w3c.dom.CharacterData;

import java.util.List;
import java.awt.datatransfer.Clipboard;

@FeignClient(name = "house-server")
public interface RequiredHouseFegin {
    @PostMapping("/required/houses/addRequiredHouse")
    AjaxResult<Boolean> addRequiredHouse(@RequestBody RequiredHouseForm requiredHouseForm);



    @GetMapping("/required/houses/getRequiredHouseDetail/{id}")
    AjaxResult<RequiredHouseVo> getRequiredHouseDetail(@PathVariable("id") Long id);

    @GetMapping("/required/houses/getRequiredHouseListByUid/{uid}")
    AjaxResult<List<RequiredHouse>> getRequiredHouseListByUid(@PathVariable Long uid);
    @GetMapping("/required/houses/deleteRequiredHouse/{id}")
    AjaxResult<Boolean> deleteRequiredHouse(@PathVariable Long id);

    @PostMapping("/required/houses/updateRequiredHouse")
    AjaxResult<Boolean> updateRequiredHouse(@RequestBody RequiredHouseForm requiredHouseForm);

    @GetMapping("/required/houses/getRequiredHouseById/{id}/{userId}")
    AjaxResult<RequiredHouseVo> getRequiredHouseById(@PathVariable Long id,@PathVariable Long userId);

    @PostMapping("/required/houses/reportRequiredHouse")
    AjaxResult<Boolean> reportRequiredHouse(@RequestBody RequiredReportForm requiredReportForm);

    @GetMapping("/required/houses/collect/{rid}/{uid}")
    AjaxResult <Boolean> collect(@PathVariable Long rid,@PathVariable Long uid);

    @GetMapping("/required/houses/cancelCollect/{rid}/{uid}")
    AjaxResult<Boolean> cancelCollect(@PathVariable Long rid, @PathVariable Long uid);


    @PostMapping("/required/houses/getRequiredHouseList")
    AjaxResult<Page<RequiredHousePage>> getRequiredHouseList(
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
            @RequestBody(required = false) RequiredHouseForm requiredHouseForm
    );
}
